//
//  ZYQAppDelegate.h
//  小庆聊天室
//
//  Created by 张毓庆 on 13-12-8.
//  Copyright (c) 2013年 张毓庆. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "XMPPFramework.h"

typedef void(^successBlock)();
typedef void(^failedBlock)();
#define xmppDelegate (ZYQAppDelegate *)[[UIApplication sharedApplication] delegate]

@interface ZYQAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

#pragma mark - xmpp属性和方法
/**
 *  全局的xmppStream,只读属性
 */
@property (strong,nonatomic,readonly) XMPPStream *xmppStream;

/**
 *  全局的电子名片模块
 */
@property (strong,nonatomic,readonly) XMPPvCardTempModule *xmppvCardModule;

/**
 *  这个是花名册的存储模块
 */
@property (strong,nonatomic,readonly) XMPPRosterCoreDataStorage *xmppRosterCoreDataStorage;
/**
 *  花名册
 */
@property (strong,nonatomic,readonly) XMPPRoster *xmppRoster;

/**
 *  头像的模块
 */
@property (strong,nonatomic,readonly) XMPPvCardAvatarModule *xmppvCardAvatarModule;

/**
 *  消息的存储归档
 */
@property (strong,nonatomic,readonly) XMPPMessageArchiving *xmppMessageArchiving;
/**
 *  消息的存储归档
 */
@property (strong,nonatomic,readonly) XMPPMessageArchivingCoreDataStorage *xmppMessageArchivingCoreDataStorage;


/**
 *  是否是用户标识
 */
@property (assign,nonatomic) BOOL isRegisterUser;
/**
 *  连接服务器,用户的信息是保存在偏好设置中
 *
 *  @param success 连接成功的块代码
 *  @param failed  连接失败的块代码
 */
- (void)connectWithSuccessBlock:(successBlock)success failed:(failedBlock)failed;

/**
 *  注销用户登录
 */
- (void)logout;

@end
